/**
 * test cgi
 */
#include "cgi.h"

using namespace cppcgi;

int main(int argc, char** argv)
{
    Head();
    CppCgi $ = cppcgi_global;
    cout << GetEnv("HOME") << endl;
    cout << GetEnv("REQUEST_METHOD") << endl;
    if ($.file["upfile"].name != NULL)
    {
        string filePath = "../../www/upload/files/" + string($.file["upfile"].name);
        SaveToFile($.file["upfile"].data, filePath.c_str(), $.file["upfile"].size);
        cout << $.file["upfile"].name << endl;
        cout << $.file["upfile"].size << endl;
    }
    return 0;
}
